public class TextBasedContent : HttpResponseContent, EmptyClass {
    public string _content {get; private set;}
    public string _content_type {get; private set;}
    TextBasedContent(string content, string content_type) {
        this.__content = content;
        this.__content_type = content_type;
    }
    public async ByteArray content(HttpResponse response) {
        response.content_type.value = this._content_type;
        var bytes = new ByteArray.take(this._content.data);
        return bytes;
    }
}

public class TextContent : TextBasedContent {
    public TextContent(string text) {
        base(text, "text/plain");
    }
}
public class HtmlContent : TextBasedContent {
    public HtmlContent(string html) {
        base(html, "text/html");
    }
}
public class JsonContent : TextBasedContent {
    public JsonContent(Object object, bool? pretty = false) {
        uint64 size;
        var jsonText = Json.gobject_to_data(object, out size);
        base(jsonText, "application/json");
    }
    
}
